#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <algorithm>
using namespace std;
vector<int> generateRandomArray(int maxsize, int minvalue, int maxvalue) {
    vector<int> arr(maxsize);
    for(int i = 0; i < maxsize; i++) {
        arr[i] = rand() % (maxvalue - minvalue + 1) + minvalue; 
    }
    return arr;
}
bool isEqual(vector<int>& a, vector<int> b) {
    if(a.size() != b.size()) {
        return false;
    }
    for(size_t i = 0; i < a.size(); i++) {
        if(a[i] != b[i]) {
            return false;
        }
    }
    return true;
}
void myswap(vector<int>& arr, int i, int j) {
    int temp = arr[i];
    arr[i] = arr[j];
    arr[j] = temp;
}
void merge(vector<int>& a, int L, int mid, int R) {
    vector<int> temp(R - L + 1);
    int i = 0;
    int p1 = L;
    int p2 = mid + 1;
    while(p1 <= mid && p2 <= R) {
        temp[i++] = a[p1] < a[p2] ? a[p1++] : a[p2++]; 
    }
    while(p1 <= mid) {
        temp[i++] = a[p1++];
    }
    while(p2 <= R) {
        temp[i++] = a[p2++];
    }
    for(int i = L; i < R + 1; i++) {
        a[i] = temp[i - L];
    }
}
void mergeSort(vector<int>& arr, int L, int R) {
    if(L == R) {
        return;
    }
    int mid = L + ((R - L) >> 1);
    mergeSort(arr, L, mid);
    mergeSort(arr, mid + 1, R);
    merge(arr, L, mid, R);
}
int main() 
{
    srand(static_cast<unsigned>(time(0)));
    int maxsize = 10000;
    int minvalue = 1;
    int maxvalue = 5000;
    vector<int> arr1 = generateRandomArray(maxsize, minvalue, maxvalue);
    vector<int> arr2 = arr1;
    mergeSort(arr1, 0, arr1.size() - 1);
    sort(arr2.begin(), arr2.end());
    if(isEqual(arr1, arr2)) {
        cout << "Nice" << endl;
    } else {
        cout << "Fucking fucked" << endl;
    }
    return 0;
}